ostree.git
11 years agoadmin: Add ot_admin_checksum_version to get a dup of the version for a commit
James Antill [Wed, 22 Oct 2014 05:21:14 +0000 (01:21 -0400)]
admin: Add ot_admin_checksum_version to get a dup of the version for a commit

11 years agocorrupt-repo-ref.js: more aggressive file corruption
Giuseppe Scrivano [Wed, 22 Oct 2014 17:52:12 +0000 (19:52 +0200)]
corrupt-repo-ref.js: more aggressive file corruption

changing only a byte may not generate a corrupted file, so play very
safe and change 10 bytes.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agofsck: report the correct error when a present file cannot be loaded
Giuseppe Scrivano [Wed, 22 Oct 2014 16:06:29 +0000 (18:06 +0200)]
fsck: report the correct error when a present file cannot be loaded

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: test-admin-deploy-switch doesn't use deprecated "current" symlink
Giuseppe Scrivano [Tue, 21 Oct 2014 19:08:15 +0000 (21:08 +0200)]
tests: test-admin-deploy-switch doesn't use deprecated "current" symlink

commit dfeb27eca55d923c57735e491e438ae54f8cc201 removed it, so change
the test to not use it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: fix --help test
Giuseppe Scrivano [Tue, 21 Oct 2014 14:20:58 +0000 (16:20 +0200)]
tests: fix --help test

Check for "Usage" only in the root command, builtins may not output
it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agomake ostree_cmd__private__ ret value const
Giuseppe Scrivano [Tue, 21 Oct 2014 09:22:51 +0000 (11:22 +0200)]
make ostree_cmd__private__ ret value const

11 years agorepo: When writing to a non-root owned repo, chown() objects to match
Colin Walters [Tue, 21 Oct 2014 18:34:04 +0000 (14:34 -0400)]
repo: When writing to a non-root owned repo, chown() objects to match

Some package systems need to be run as root, so the process linking to
libostree may also be root.  However, it's reasonable to have the
target repository be owned by a uid other than root.

This patch makes it Just Work by chowning the file content to match.

Note this only operates on archive-z2 repositories, because you can't
usefully serve bare repositories via HTTP.

https://bugzilla.gnome.org/show_bug.cgi?id=738954

11 years agobuild: Include SELinux cflags with libostree build too
Matthew Barnes [Mon, 20 Oct 2014 15:06:51 +0000 (11:06 -0400)]
build: Include SELinux cflags with libostree build too

This is likely another issue with newer automake.

https://bugzilla.gnome.org/738875

11 years agoAdd "ostree remote delete" and corresponding API
Colin Walters [Fri, 17 Oct 2014 15:47:01 +0000 (11:47 -0400)]
Add "ostree remote delete" and corresponding API

For Anaconda, we have an ugly bootstrapping problem where we need to
add the remote to the repository's config, then do a pull+deploy, then
remove and re-add the config, because /etc/ostree/remotes.d doesn't
exist yet in the target system.

https://bugzilla.gnome.org/show_bug.cgi?id=738698

11 years agoRelease 2014.8
Colin Walters [Thu, 16 Oct 2014 20:54:55 +0000 (16:54 -0400)]
Release 2014.8

11 years agorepo: Disable uncompressed object cache on non-writable repos
Colin Walters [Thu, 16 Oct 2014 18:54:34 +0000 (14:54 -0400)]
repo: Disable uncompressed object cache on non-writable repos

While we did support disabling the uncompressed-objects-cache
per-repository:

1) We didn't actually respect that operation when doing
   CHECKOUT_MODE_USER on archive-z2 repositories
2) It'd be better to automatically detect we can't write to the
   repo and disable the uncompressed cache then.

11 years agolibostree: Add initial GRUB2 support
Colin Walters [Sat, 11 Oct 2014 12:59:06 +0000 (08:59 -0400)]
libostree: Add initial GRUB2 support

In this approach, we drop a /etc/grub.d/15_ostree file which is a
hybrid of shell/C that picks up bits from the GRUB2 library (e.g. the
block device script generation), and then calls into libostree's
GRUB2 code which knows about the BLS entries.

This is admittedly ugly.  There exists another approach for GRUB2 to
learn the BLS specification.  However, the spec has a few issues:

https://www.redhat.com/archives/anaconda-devel-list/2014-July/msg00002.html

This approach also gives a bit more control to the admin via the
naming of the 15_ostree symlink; they can easily disable it:

Or reorder the ostree entries ahead of 10_linux:

Also, this approach doesn't require patches for grub2, which is an
issue with the pressure to backport (rpm-)OSTree to EL7.

11 years agohttp: set the HTTP status on directory listing
Giuseppe Scrivano [Tue, 7 Oct 2014 11:10:08 +0000 (13:10 +0200)]
http: set the HTTP status on directory listing

Fix a HTTP response header like the following:

HTTP/1.1 0 (null)
Server: ostree-httpd libsoup/2.48.0
Date: Tue, 07 Oct 2014 11:19:22 GMT
Content-Type: text/html
Content-Length: 12533

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotests: do not leave running httpd after tests exit
Giuseppe Scrivano [Tue, 7 Oct 2014 10:05:59 +0000 (12:05 +0200)]
tests: do not leave running httpd after tests exit

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agotrivial-httpd: Another followup fix - need to listen on all interfaces
Colin Walters [Mon, 6 Oct 2014 21:43:02 +0000 (17:43 -0400)]
trivial-httpd: Another followup fix - need to listen on all interfaces

This was the intended design, but it regressed when updating.

11 years agolibostree: fix a gobject-introspection warning
Giuseppe Scrivano [Mon, 6 Oct 2014 16:54:18 +0000 (18:54 +0200)]
libostree: fix a gobject-introspection warning

src/libostree/ostree-repo.c:1759: Warning: OSTree:
  ostree_repo_import_object_from: unknown parameter 'checksum' in
  documentation comment, should be 'sha256'

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoRelease 2014.7
Colin Walters [Fri, 3 Oct 2014 23:10:13 +0000 (19:10 -0400)]
Release 2014.7

11 years agoAdd missing file from previous commit
Colin Walters [Fri, 3 Oct 2014 18:38:30 +0000 (14:38 -0400)]
Add missing file from previous commit

11 years agoAdd "unconfigured-state" concept to origin files
Colin Walters [Tue, 30 Sep 2014 22:12:08 +0000 (18:12 -0400)]
Add "unconfigured-state" concept to origin files

Some operating systems may come with external tools for subscription
management that drive access to the content.  In that case, the origin
file may not be useful (for example, it could refer to an installer
ISO).

This patch will allow OS installers to inject that state, with a
useful error message, directing the system administrator to an
external tool.

See: https://github.com/projectatomic/rpm-ostree/issues/31

https://bugzilla.gnome.org/show_bug.cgi?id=737686

11 years agopull: Support full recursive mirrors of repositories with summary file
Colin Walters [Thu, 2 Oct 2014 21:49:26 +0000 (17:49 -0400)]
pull: Support full recursive mirrors of repositories with summary file

Now that we have a summary file, we can use it to allow a simple:

ostree pull --mirror

To download the latest commit on every branch.  Also, for a case I'm
dealing with there's only one branch, but I don't want mirror users to
have to hardcode it.

https://bugzilla.gnome.org/show_bug.cgi?id=737807

11 years agoAdd API to directly link() objects between repositories
Colin Walters [Thu, 2 Oct 2014 03:19:31 +0000 (23:19 -0400)]
Add API to directly link() objects between repositories

And use it in pull-local.  As one might expect, this is blazingly fast
if they're on the same filesystem.

I'll be using this to "promote" builds between different repositories.

11 years agoupgrader: Hold a ref to the origin
Colin Walters [Tue, 30 Sep 2014 14:22:57 +0000 (10:22 -0400)]
upgrader: Hold a ref to the origin

We unref it in _finalize, so we need to hold a ref.  I *thought*
this was the source of
https://github.com/projectatomic/rpm-ostree/issues/30

But apparently not =/

11 years agoTest 'ostree admin --print-current-dir'
Owen W. Taylor [Fri, 26 Sep 2014 15:54:04 +0000 (11:54 -0400)]
Test 'ostree admin --print-current-dir'

Add a test for the --print-current-dir option

https://bugzilla.gnome.org/show_bug.cgi?id=731051

11 years agoAdd test case for 'admin instutil set-kargs'
Owen W. Taylor [Fri, 26 Sep 2014 15:43:46 +0000 (11:43 -0400)]
Add test case for 'admin instutil set-kargs'

Test out the newly added options to 'instutil set-kargs' along with
the existing functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=731051

11 years agoostree admin: Add a --print-current-dir option
Owen W. Taylor [Tue, 23 Sep 2014 15:32:44 +0000 (11:32 -0400)]
ostree admin: Add a --print-current-dir option

Add an option --print-current-dir that prints the current deployment
directory to stdout and exits.

https://bugzilla.gnome.org/show_bug.cgi?id=731051

11 years agoostree admin instutil set-kargs: make more flexible
Owen W. Taylor [Tue, 23 Sep 2014 15:16:53 +0000 (11:16 -0400)]
ostree admin instutil set-kargs: make more flexible

Add command line arguments:
 --import-proc-cmdline: import values from /proc/cmdline
 --merge: import current values
 --replace=ARG=VALUE: replace value
 --append=ARG=VALUE: append a new argument

Extra command line arguments are treated like --append=, which
gives backwards compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=731051

11 years agotrivial-httpd: Further fixes for previous commit
Colin Walters [Thu, 25 Sep 2014 20:03:06 +0000 (16:03 -0400)]
trivial-httpd: Further fixes for previous commit

11 years agoFollowup to SoupServer port deprecation
Colin Walters [Thu, 25 Sep 2014 19:57:58 +0000 (15:57 -0400)]
Followup to SoupServer port deprecation

My patch didn't actually work with newer libsoup.

11 years agoAdd test for the behavior of --help
Owen W. Taylor [Thu, 25 Sep 2014 07:05:45 +0000 (03:05 -0400)]
Add test for the behavior of --help

Recursive over ostree and all subcommands, and check that --help
is supported, properly outputs to standard out, and exits
with a 0 exit status. Check that for commands with subcommands,
they produce the help output to standard error when run with no arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years ago--help should always go to stdout
Owen W. Taylor [Thu, 25 Sep 2014 06:34:30 +0000 (02:34 -0400)]
--help should always go to stdout

The standard convention is that the  output of --help should go to standard
output (so that it can be piped to a pager and searched.) See, e.g., the
GNU coding standards.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years agoostree admin instutil: make --help work for subcommands
Owen W. Taylor [Wed, 24 Sep 2014 13:23:56 +0000 (09:23 -0400)]
ostree admin instutil: make --help work for subcommands

Even though the subcommands don't take arguments, use a GOptionContext
so that --help works as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years agoFix help output for nested subcommands
Owen W. Taylor [Tue, 23 Sep 2014 19:33:13 +0000 (15:33 -0400)]
Fix help output for nested subcommands

Only 'ostree admin' was appearing in the help message for commands
nested within ostree admin.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years agoPass --help to the most nested subcommand
Owen W. Taylor [Tue, 23 Sep 2014 19:31:30 +0000 (15:31 -0400)]
Pass --help to the most nested subcommand

'ostree admin <x> --help' and 'ostree admin instutil <x> --help' should
give help on the deepest subcommand, not on 'ostree admin'.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years agoostree admin: Fix return value from 'ostree admin [instutil]'
Owen W. Taylor [Tue, 23 Sep 2014 15:58:27 +0000 (11:58 -0400)]
ostree admin: Fix return value from 'ostree admin [instutil]'

'ostree admin' and 'ostree admin instuil' with no arguments were meant to fail,
but the logic was wrong; add an assertion on the return value from all ostree
commands to catch similar problems in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=737194

11 years agodeploy: Copy parent directories for modified config files
Colin Walters [Mon, 15 Sep 2014 13:29:26 +0000 (09:29 -0400)]
deploy: Copy parent directories for modified config files

Previously, in the case where a parent directory of a modified config
file was removed, we would throw an exception.  This happens when
switching from a tree that has some software (e.g. firewalld), to one
that does not.

While it's nice to have this warning that your config file probably no
longer applies, there's no need to make it so...fatal.

It's particularly problematic that the only easy workaround is to
remove the config files from your current tree - which breaks
rollback.

The solution then is for for us to take ownership of the parent
directories too into the new /etc.  Admins can clean up these files
afterwards at any time.

https://bugzilla.gnome.org/show_bug.cgi?id=734293

11 years agoExtract opendirat() helper function into libotutil
Colin Walters [Tue, 16 Sep 2014 15:15:36 +0000 (11:15 -0400)]
Extract opendirat() helper function into libotutil

We were duplicating the code to do an opendirat() in a few places.

11 years agodeploy: Remove legacy "current" symbolic links
Colin Walters [Sat, 31 May 2014 17:53:10 +0000 (13:53 -0400)]
deploy: Remove legacy "current" symbolic links

Per comment, this was a temporary non-atomic hack, and it's time to
remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=731051

11 years agodeploy: Clean up leftover state before creating new directories
Colin Walters [Thu, 10 Jul 2014 19:19:50 +0000 (15:19 -0400)]
deploy: Clean up leftover state before creating new directories

This fixes a regression introduced with https://git.gnome.org/browse/ostree/commit/?id=7baa600e237b326899de2899a9bc54a6b863943c

The original code in "ostree admin upgrade" had a comment:

 /* Here we perform cleanup of any leftover data from previous
  * partial failures. This avoids having to call gs_shutil_rm_rf()
  * at random points throughout the process. */

But since I deleted that initial cleanup call, we *do* need to do the
cleanup during the process run.  It turns out there are only a few
places this is necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=733030

11 years agodeploy: Consistently use fd-relative API
Colin Walters [Sat, 13 Sep 2014 14:36:59 +0000 (10:36 -0400)]
deploy: Consistently use fd-relative API

While looking to fix a different bug here, I found the current
state of things where we had a mix of fd-relative API versus not
frustrating.

Change the code around to consistently use *at, and also add some more
tests.

11 years agoWork around deprecation of SoupServer's port property
Colin Walters [Tue, 9 Sep 2014 13:30:02 +0000 (09:30 -0400)]
Work around deprecation of SoupServer's port property

See https://bugzilla.gnome.org/show_bug.cgi?id=732184

11 years agoRelease 2014.6
Colin Walters [Mon, 8 Sep 2014 17:24:41 +0000 (13:24 -0400)]
Release 2014.6

11 years agopull: Squash some uninitialized variable warnings
Colin Walters [Mon, 8 Sep 2014 17:42:50 +0000 (13:42 -0400)]
pull: Squash some uninitialized variable warnings

11 years agobuild: We also work OK with LZMA 5.0
Vincent Batts [Mon, 8 Sep 2014 14:35:32 +0000 (10:35 -0400)]
build: We also work OK with LZMA 5.0

This is the version that's in Slackware at the moment at least.

11 years agobuild: Unify CPPFLAGS settings
Colin Walters [Mon, 8 Sep 2014 15:47:58 +0000 (11:47 -0400)]
build: Unify CPPFLAGS settings

The libostree core uses SYSCONFDIR now, so we should ensure it's used
consistently.  Someone else was seeing SYSCONFDIR not being defined
while compiling with a newer automake version, which may process
CPPFLAGS more precisely.

11 years agodoc: Add a man page for summary command
Colin Walters [Sun, 7 Sep 2014 21:41:12 +0000 (17:41 -0400)]
doc: Add a man page for summary command

11 years agoDrop g_type_init() call now that we depend on GLib 2.36
Colin Walters [Sun, 7 Sep 2014 16:58:10 +0000 (12:58 -0400)]
Drop g_type_init() call now that we depend on GLib 2.36

11 years agoAdd repository "summary" file and metalink support
Colin Walters [Thu, 31 Jul 2014 22:50:19 +0000 (18:50 -0400)]
Add repository "summary" file and metalink support

For Fedora and potentially other distributions which use globally
distributed mirrors, metalink is a popular solution to redirect
clients to a dynamic set of mirrors.

In order to make metalink work though, it needs *one* file which can
be checksummed.  (Well, potentially we could explode all refs into the
metalink.xml, but that would be a lot more invasive, and a bit weird
as we'd end up checksumming the checksum file).

This commit adds a new command:

$ ostree summary -u

To regenerate the summary file.  Can only be run by one process at a
time.

After that's done, the metalink can be generated based on it, and the
client fetch code will parse and load it.

https://bugzilla.gnome.org/show_bug.cgi?id=729585

11 years agoBump GIO dependency to 2.38 for GTask
Colin Walters [Mon, 18 Aug 2014 20:19:00 +0000 (16:19 -0400)]
Bump GIO dependency to 2.38 for GTask

I'd like to use GTask, so bump the dependency.

https://bugzilla.gnome.org/show_bug.cgi?id=729585

11 years agofetcher: Close request body on error paths
Colin Walters [Wed, 20 Aug 2014 14:23:28 +0000 (10:23 -0400)]
fetcher: Close request body on error paths

Otherwise, we're potentially holding up subsequent requests.

I was hitting this when testing the metalink code, where we want to
continue doing more fetches after hitting a 404.

https://bugzilla.gnome.org/show_bug.cgi?id=729585

11 years agopull: Fix use-after-free
Anne LoVerso [Thu, 21 Aug 2014 17:45:55 +0000 (13:45 -0400)]
pull: Fix use-after-free

The strchr() was pointing into a string we were freeing.

11 years agorepo-pull: Allow pulling only one directory
Anne LoVerso [Tue, 5 Aug 2014 12:41:50 +0000 (08:41 -0400)]
repo-pull: Allow pulling only one directory

Changes the pull API to allow pulling only a single directory instead
of the whole deployment.  This option is utilized by the check-diff
option in rpm-ostree.

Add a new state directory to hold <checksum>.commitpartial files, so
we know that we've only downloaded partial state.

11 years agosysroot: Add precondition that load() has been called for some API calls
Colin Walters [Fri, 15 Aug 2014 19:21:40 +0000 (15:21 -0400)]
sysroot: Add precondition that load() has been called for some API calls

We require the caller to invoke load() at the moment to do most
things.

11 years agodeploy: Also honor multiply-specified kernel args with existing config
Colin Walters [Sun, 3 Aug 2014 18:32:52 +0000 (14:32 -0400)]
deploy: Also honor multiply-specified kernel args with existing config

If we deployed a new tree inside an existing OS, inheriting kernel
args, we need to use append() instead of replace() to avoid collapsing
multiply specified kernel arguments like console=/dev/foo
console=/dev/bar.

Reported-by: Dusty Mabe <dusty@dustymabe.com>
11 years agopackaging: Make the ostree rpm own and create /etc/ostree/remotes.d/
Dusty Mabe [Sat, 2 Aug 2014 22:09:52 +0000 (18:09 -0400)]
packaging: Make the ostree rpm own and create /etc/ostree/remotes.d/

11 years agodeploy: Propertly append multiple kernel arguments with --karg-proc-cmdline
Colin Walters [Fri, 1 Aug 2014 12:54:17 +0000 (08:54 -0400)]
deploy: Propertly append multiple kernel arguments with --karg-proc-cmdline

We want to allow multiply specified arguments, as it's useful for
things like console= and rd.lvm.lv.

See: https://bugzilla.gnome.org/show_bug.cgi?id=721136

Reported-by: Dusty Mabe <dustymabe@gmail.com>
11 years agodoap category infrastructure
Olav Vitters [Thu, 31 Jul 2014 09:26:32 +0000 (11:26 +0200)]
doap category infrastructure

11 years agocore: Support a per-remote "proxy" configuration option
Colin Walters [Fri, 25 Jul 2014 11:55:55 +0000 (07:55 -0400)]
core: Support a per-remote "proxy" configuration option

We don't want to have to force people to set it in the environment.

https://bugzilla.gnome.org/show_bug.cgi?id=733734

11 years agoDisplay bytes/second during pull
James Antill [Fri, 25 Jul 2014 06:10:53 +0000 (02:10 -0400)]
Display bytes/second during pull

Add start time to the AsyncProgress object, use it in the common
progress.

11 years agopull: override max-conns-per-host to 8, for faster downloads
James Antill [Fri, 25 Jul 2014 14:08:02 +0000 (10:08 -0400)]
pull: override max-conns-per-host to 8, for faster downloads

Modern web browsers are all converging on 6 or 8.  Let's match that.

11 years agorefs: Don't try searching for input strings that can't be objects
Colin Walters [Wed, 23 Jul 2014 19:09:24 +0000 (15:09 -0400)]
refs: Don't try searching for input strings that can't be objects

I noticed OSTree was a bit slower, did some investigation
and saw we were enumerating all objects for things like

$ ostree rev-parse blah

Since "blah" can never be an object (because of the 'l' and 'h'), just
return no matches.

11 years agopull-local: Write detached metadata into the correct repository
Colin Walters [Tue, 22 Jul 2014 19:42:56 +0000 (15:42 -0400)]
pull-local: Write detached metadata into the correct repository

We want to write to the dest repo, not src.

Noticed while reviewing this code for some other bug.

https://bugzilla.gnome.org/show_bug.cgi?id=733579

11 years agorepofile: Avoid segfault if querying child in non-directory
Colin Walters [Mon, 21 Jul 2014 02:32:39 +0000 (22:32 -0400)]
repofile: Avoid segfault if querying child in non-directory

The user might "ostree ls /usr/bin/bash/blah", which previously would
segfault.

A somewhat related future enhancement here would be for "ostree ls" to
follow symbolic links.

Reported-by: Dusty Mabe <dustymabe@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=733476

11 years agocore: Do enumerate ff/ objects as well
Colin Walters [Sun, 20 Jul 2014 16:20:51 +0000 (12:20 -0400)]
core: Do enumerate ff/ objects as well

An embarassing off-by-one here.  I noticed we weren't pruning them.

https://bugzilla.gnome.org/show_bug.cgi?id=733458

11 years agocore: Do enumerate content objects in archive-z2 repositories
Colin Walters [Sun, 20 Jul 2014 16:18:09 +0000 (12:18 -0400)]
core: Do enumerate content objects in archive-z2 repositories

Prune has worked fine on bare repositories for some time, but now that
I finally try to delete data on the server side, I notice we weren't
actually enumerating content objects =/

That caused them to not be pruned.

https://bugzilla.gnome.org/show_bug.cgi?id=733458

11 years agocore: Unify object deletion code with prune
Colin Walters [Sun, 20 Jul 2014 12:35:58 +0000 (08:35 -0400)]
core: Unify object deletion code with prune

The prune API duplicated logic to delete objects, and furthermore the
core API to delete an object didn't clean up detached metadata.

Fix the duplication by doing the obvious thing: prune should call
_delete.

https://bugzilla.gnome.org/show_bug.cgi?id=733452

11 years agoFix typo in previous commit
Colin Walters [Fri, 18 Jul 2014 19:49:40 +0000 (15:49 -0400)]
Fix typo in previous commit

11 years agoostree-repo-resolve-rev: Add function to accept a partial checksum
Anne LoVerso [Fri, 11 Jul 2014 18:00:45 +0000 (14:00 -0400)]
ostree-repo-resolve-rev: Add function to accept a partial checksum

This patch adds a function that will parse a partial checksum when
resolving a refspec.  If the inputted refspec matches a truncated
existing checksum, it will return that checksum to be parsed.  If
multiple truncated checksums match the partial refspec, it is not
unique and will return false.  This addition is inspired by the same
functionality in Docker, which allows a user to reference a specific
commit without typing the entire checksum.

partial checksums: Add function to abstract comparison

This modifies the list_objects and list_objects_at functions
to take an additional argument for the string that a commit starts
with.  If this string arg is not null, it will only list commit
objects beginning with that string.  This allows for a new function
ostree_repo_list_commit_objects_starting_with to pass a partial string
and return a list of all matching commits.  This improves on the
previous strategy of listing refs because it will list all commit objects,
even ones in past history.  This update also includes bugfixes on
error handling and string comparison, and changes the output structure
of resolve_partial_checksum. The new strcuture will no longer return FALSE
without error.  Also, the hashtable foreach now uses iter.  Also
includes modified test file

11 years agocore: Use ostree_commit_get_parent in ostree_repo_resolve_rev
James Antill [Fri, 18 Jul 2014 04:01:31 +0000 (00:01 -0400)]
core: Use ostree_commit_get_parent in ostree_repo_resolve_rev

11 years agoostree-remount: mount a tmpfs on /var if necessary so /var is read-write
Owen W. Taylor [Wed, 9 Jul 2014 23:07:38 +0000 (19:07 -0400)]
ostree-remount: mount a tmpfs on /var if necessary so /var is read-write

/var needs to be read-write for a functioning system. Various
systemd services will fail to start if /var is read-only. After we
remount /var (or if we skip remounting /var because / is read-only),
if /var is still readonly, mount a tmpfs file system on /var.

While this isn't strictly part of ostree, keeping it here makes sense
because it keeps twiddling around with the /var mount in one place
for easier coordination and maintenance. This will likely need updating
if systemd gains better support for a readonly root filesystem.

https://bugzilla.gnome.org/show_bug.cgi?id=732979

11 years agopull: Only set ca path if we actually have a setting for it
Colin Walters [Tue, 1 Jul 2014 12:50:05 +0000 (08:50 -0400)]
pull: Only set ca path if we actually have a setting for it

Otherwise, GTlsFileDatabase ends up accepting NULL for anchors, and
then we don't trust any CAs at all.

https://bugzilla.gnome.org/show_bug.cgi?id=726256

11 years agocore: add "tls-ca-path" option
Colin Walters [Thu, 26 Jun 2014 23:39:26 +0000 (19:39 -0400)]
core: add "tls-ca-path" option

Some organizations will want to use private Certificate Authorities to
serve content to their clients.  While it's possible to add the CA
to the system-wide CA store, that has two drawbacks:

1) Compromise of that cert means it can be used for other web traffic
2) All of ca-certificates is trusted

This patch allows a much stronger scenario where *only* the CAs in
tls-ca-path are used for verification from the given repository.

https://bugzilla.gnome.org/show_bug.cgi?id=726256

11 years agoAdd --enable-libsoup-client-certs
Colin Walters [Thu, 26 Jun 2014 11:54:41 +0000 (07:54 -0400)]
Add --enable-libsoup-client-certs

The goal of this is to hard-fail if the API isn't present in the
buildroot, as some downstreams may explicitly require it.

11 years ago[trivial]: Update .gitignore
Colin Walters [Tue, 24 Jun 2014 12:32:22 +0000 (08:32 -0400)]
[trivial]: Update .gitignore

11 years agomanpage: Add separate manpages for each command
Anne LoVerso [Tue, 17 Jun 2014 19:24:08 +0000 (15:24 -0400)]
manpage: Add separate manpages for each command

Using docker as a model, this update creates separate manpages
for each OSTree command, such that the main manpage is not
cluttered and the separate pages can provide more in-depth detail
and exanples that might be useful to a user.  Each page includes
synopsis, description, example, and a list of options if needd.
This update also alphabetizes the usage error output for ostree
and ostree admin so that it matches the list on the manpage.

11 years ago[staticanalysis]: Delete an unused variable
Colin Walters [Sat, 21 Jun 2014 21:36:23 +0000 (17:36 -0400)]
[staticanalysis]: Delete an unused variable

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix in_status_line
Colin Walters [Sat, 21 Jun 2014 21:35:03 +0000 (17:35 -0400)]
[staticanalysis]: Fix in_status_line

We need to end the status line *after* we've done a pull, as ostree
admin upgrade does.  Also add the correct in_status_line assignment.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix some dead code
Colin Walters [Sat, 21 Jun 2014 21:34:20 +0000 (17:34 -0400)]
[staticanalysis]: Fix some dead code

One was an unused variable, the other is actually dead because we
can't have mfile != NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Actually check errors on splice() of objects
Colin Walters [Sat, 21 Jun 2014 21:30:11 +0000 (17:30 -0400)]
[staticanalysis]: Actually check errors on splice() of objects

We were using unsigned size when we should have been using signed,
this means we basically weren't checking for errors on write...ouch.

Luckily if we e.g. hit ENOSPC during a pull, the checksums wouldn't
match and we'd return an error anyways.  However when writing an
object, we'd end up silently ignoring it =/

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Add assertion to pacify analyzer
Colin Walters [Sat, 21 Jun 2014 21:28:54 +0000 (17:28 -0400)]
[staticanalysis]: Add assertion to pacify analyzer

This condition can't actually be hit, let's hint that's the case.

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Add missing va_end()
Colin Walters [Sat, 21 Jun 2014 21:24:06 +0000 (17:24 -0400)]
[staticanalysis]: Add missing va_end()

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years ago[staticanalysis]: Fix two uses of uninitialized variables
Colin Walters [Sat, 21 Jun 2014 21:22:55 +0000 (17:22 -0400)]
[staticanalysis]: Fix two uses of uninitialized variables

https://bugzilla.gnome.org/show_bug.cgi?id=732020

11 years agopackaging: BR e2p
Colin Walters [Sat, 21 Jun 2014 20:55:36 +0000 (16:55 -0400)]
packaging: BR e2p

11 years agoremote: Minor argument parsing cleanup
Colin Walters [Sat, 21 Jun 2014 16:11:56 +0000 (12:11 -0400)]
remote: Minor argument parsing cleanup

Only access relevant portion of argv after we've verified argc.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agoremote: Fix regression in previous commit wrt adding branches
Colin Walters [Sat, 21 Jun 2014 16:10:24 +0000 (12:10 -0400)]
remote: Fix regression in previous commit wrt adding branches

branches is always NULL at that point, we want to look at argc.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agolibostree: Add ostree_repo_remote_add() API, port "ostree remote add"
Colin Walters [Fri, 20 Jun 2014 08:58:31 +0000 (04:58 -0400)]
libostree: Add ostree_repo_remote_add() API, port "ostree remote add"

At least one external tool is using the API, and wants to add a
remote, but all of the logic right now is in the tool.  Move it to the
library.

https://bugzilla.gnome.org/show_bug.cgi?id=731984

11 years agotests: Add a test for an empty /etc directory gaining content
Colin Walters [Thu, 19 Jun 2014 19:53:20 +0000 (15:53 -0400)]
tests: Add a test for an empty /etc directory gaining content

https://bugzilla.gnome.org/show_bug.cgi?id=731924

11 years agodoc: Update overview a bit
Colin Walters [Fri, 20 Jun 2014 15:59:49 +0000 (11:59 -0400)]
doc: Update overview a bit

Link to docker, note in introductory paragraph the goal of package
composition on a server.

11 years agodoc: adapting-existing: Update story on latest /usr/lib/passwd bits
Colin Walters [Fri, 20 Jun 2014 14:13:33 +0000 (10:13 -0400)]
doc: adapting-existing: Update story on latest /usr/lib/passwd bits

11 years agodoc: No need to emphasize the poweroff vs other OSes so much
Colin Walters [Fri, 20 Jun 2014 14:13:09 +0000 (10:13 -0400)]
doc: No need to emphasize the poweroff vs other OSes so much

11 years agodoc: Update links to Continuous
Colin Walters [Fri, 20 Jun 2014 14:12:53 +0000 (10:12 -0400)]
doc: Update links to Continuous

11 years agodocs: overview: Explicitly call out dpkg/rpm
Colin Walters [Fri, 20 Jun 2014 14:11:42 +0000 (10:11 -0400)]
docs: overview: Explicitly call out dpkg/rpm

To be more clear that we don't handle "inventory".

11 years agopull: Emit a better error if the remote isn't found
Colin Walters [Fri, 6 Jun 2014 20:17:05 +0000 (16:17 -0400)]
pull: Emit a better error if the remote isn't found

The generic GKeyFile error isn't quite informative enough here.

I hit this with the new compose process where we don't automatically
inject a configured remote into the generated disk images; we expect
people to add them.

https://bugzilla.gnome.org/show_bug.cgi?id=731346

11 years agotests: Add a test which exercises --fsync=false
Colin Walters [Wed, 18 Jun 2014 22:24:41 +0000 (18:24 -0400)]
tests: Add a test which exercises --fsync=false

11 years agocore: Fix g_file_get_uri/get_parse_name for non-root ostree files
James Antill [Wed, 18 Jun 2014 06:57:19 +0000 (02:57 -0400)]
core: Fix g_file_get_uri/get_parse_name for non-root ostree files

11 years agocommit: Hide --disable-fsync option, add --fsync which takes a boolean
James Antill [Tue, 10 Jun 2014 05:44:10 +0000 (01:44 -0400)]
commit: Hide --disable-fsync option, add --fsync which takes a boolean

Per discussion on mailing list, the --disable-fsync has a
double-negative thing going on; --fsync=false is clearer.

11 years agocat: Fix a typo in usage error printout
Anne LoVerso [Fri, 6 Jun 2014 14:54:05 +0000 (10:54 -0400)]
cat: Fix a typo in usage error printout

11 years agopull: Support --mirror option
Colin Walters [Mon, 16 Jun 2014 21:11:50 +0000 (17:11 -0400)]
pull: Support --mirror option

There's several use cases for calling into ostree itself to do
mirroring, instead of using bare rsync.  For example, it's a bit more
efficient as it doesn't require syncing the objects/ directory.

https://bugzilla.gnome.org/show_bug.cgi?id=728351

11 years agolog: Print a friendly error if we haven't downloaded the complete history
Colin Walters [Wed, 11 Jun 2014 20:40:50 +0000 (16:40 -0400)]
log: Print a friendly error if we haven't downloaded the complete history

For the local repository on the system, it's not the usual case to
have the complete compose history.  Rather than erroring out, provide
a bit more friendly message.

https://bugzilla.gnome.org/show_bug.cgi?id=731538

11 years agoRelease 2014.5
Colin Walters [Mon, 9 Jun 2014 22:39:14 +0000 (18:39 -0400)]
Release 2014.5

11 years agolibostree: Silently ignore EPERM when setting EXT2_IMMUTABLE_FL
Colin Walters [Wed, 4 Jun 2014 22:21:32 +0000 (18:21 -0400)]
libostree: Silently ignore EPERM when setting EXT2_IMMUTABLE_FL

In the case of running ostree as non-root on a regular filesystem (not
tmpfs which doesn't support immutable), we should just silently do
nothing if we encounter EPERM.  Cache the result to avoid spam in
strace.

https://bugzilla.gnome.org/show_bug.cgi?id=728006